﻿using JT808.Gateway.Abstractions;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace JT808.Gateway.QueueService.Extensions
{
    public static class JT808DbContextExtension
    {
        public static IJT808ClientBuilder AddDbContext<TDbContext>(this IJT808ClientBuilder jT808ClientBuilder,
            IConfiguration configuration) where TDbContext : DbContext
        {
            jT808ClientBuilder.JT808Builder.Services.AddDbContext<TDbContext>();
            return jT808ClientBuilder;
        }
    }
}
